package com.qf.simpleTriggerTest;


import com.qf.bean.Users;
import com.qf.dao.UsersDao;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

//任务类
public class MySimpleJob implements Job {

    @Autowired
    private UsersDao usersDao;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println("简单触发器:"+new Date());
        List<Users> usersList = usersDao.findall();
        for (Users users : usersList) {
            System.out.println(users);
        }
    }
}
